﻿namespace OasisCiq.Xpil
{
    using System;
    using System.Linq;

    /// <summary>
    /// List of name types for commonly used Number type
    /// </summary>
    public class NumberTypeList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "RangeFrom", // Indicates that the element contains the lower value of a range, e.g. 25 in 25-37
            "Range", // Indicates that the value is a range, e.g. 25-37
            "RangeTo", // Indicates that the element contains the top value of a range, e.g. 25 in 25-37
            "Prefix", // Indicates that the element contains some value that is important, but not exactly the number itself. E.g. A250, where A is the prefix to the number 250
            "Suffix", // Indocates that the element contains some value that is important, but not exactly the number itself. E.g. 'bis' in '45 bis'
            "Number", // Indicates that the value is number, e.g. 2020 in ID 2020. The actual value can be alpha-numeric.
            "Separator", // Indicates that the value is a separator that is expected to be preserved. Examples are / - #, etc.
            "Extension" // Indicates that the value is an extension number of some identifier, e.g. 01 in ID 2330-01. 01 could be mean a specific semantics
        };

        public NumberTypeList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}